package com.qcby.demo.proxyaop.chain;

import com.qcby.demo.proxyaop.interceptor.Interceptor;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Method;

/**
 * @className: CompanyInterceptor
 * @description:
 * @author: lxt
 * @create: 2021-05-12 16:35
 **/
@Slf4j
public class CompanyInterceptor implements Interceptor {
    //这是公司拦截器的拦截逻辑
    @Override
    public boolean preHandle(Object proxy, Object target, Method method, Object[] args) {
        log.info("【公司preHandle方法】公司正在与您谈判前期工作");
        return true;
    }

    @Override
    public void postHandle(Object proxy, Object target, Method method, Object[] args) {
        log.info("【公司postHandle方法】");
    }

    @Override
    public void afterCompletion(Object proxy, Object target, Method method, Object[] args) {
        log.info("【公司afterCompletion方法】无论公司preHandle方法返回true或false，本方法都会被调用");
    }
}
